package com.neuedu.carsystem.dao.impl;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.neuedu.carsystem.dao.EmployeeDao;
import com.neuedu.carsystem.model.Employee;
@Repository
public class EmployeeDaoImpl implements EmployeeDao{
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}
	@Override
	public List<Employee> findEmployeeAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(EmployeeDao.class).findEmployeeAll(map);
	}
	@Override
	public Employee findById(int id) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(EmployeeDao.class).findById(id);
	}
	@Override
	public int addEmployee(Employee u) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(EmployeeDao.class).addEmployee(u);
	}
	@Override
	public int deleteEmployee(int id) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(EmployeeDao.class).deleteEmployee(id);
	}
	@Override
	public int updateEmployee(int u) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(EmployeeDao.class).updateEmployee(u);
	}
	@Override
	public int countEmployee() {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(EmployeeDao.class).countEmployee();
	}

}
